// utils/auth.ts
import { useRouter } from 'vue-router'

export async function logout() {
  const router = useRouter()
  try {
    localStorage.removeItem('jwtToken')
    localStorage.removeItem('tokenExpiration')
    router.push('/login')
  } catch (error) {
    console.error('Logout request failed:', error)
  }
}
